<template>
    <view class="mt50">
   <!--    <view class="jhbkbjxdd  pd row">
			<view class="col row">
				<image src="../../static/img/usericon.png" class="yj usericond"></image>
				<view class="col pl30">
					<view class="fz32 cf">
						Abby
					</view>
					<view class="mt20 fz26 z9">
						申请添加好友
					</view>
				</view>
			</view>
       </view> -->
	   <view class="jhbkbjxdd  pd row"  v-for="(sd,idx) in list" :key="idx">
	   			<view class="col row">
	   				<image src="../../static/img/usericon.png" class="yj usericond"></image>
	   				<view class="col pl30">
	   					<view class="fz32 cf">
	   						{{sd.name}}
	   					</view>
	   					<view class="mt20 fz26 z9">
	   						{{sd.content}}
	   					</view>
	   				</view>
	   			</view>
				
				<view class="kjhjbnxert"  @tap="seertt(idx,sd.id)" v-if="sd.status == 1">
					<view class=" cz  f_b jjhkkxert cen cf fz32">
						同意
					</view>
				</view>
	   			<view class="kjhjbnxert" v-if="sd.status == 2">
					<text class="z9 fz26">已同意</text>
	   			</view>
	   			<view class="kjhjbnxert" v-if="sd.status == 3">
					<text class="z9 fz26">已过期</text>
	   			</view>
	   </view>
	   
	   
    </view>
</template>
<script>
    export default {
        data() {
            return {
				list:[]
			}
        },
		onLoad(){
			this.getlist()
		},
        components: {},
        methods: {
			async getlist() {
				let ccar = await this.get('/api/notice/type/2/object/28')
				if(ccar.data.length !=0){
					this.list = ccar.data
				}
				console.log(ccar)
			},
			async putdata(keys,id) {
				// 同意申请
				let ccar = await this.get('/api/notice/'+id,'','PUT')
				this.list[keys].status = 2
				uni.showToast({
					title:"已通过申请"
				})
			},
			seertt(keys,id){
				this.putdata(keys,id)
			}
		},
        mounted() {}
    }

</script>
<style  scoped>
	.jhbkbjxdd{
		padding-top: 45upx;
		padding-bottom: 45upx;
	}
	.kjhjbnxert{
		width: 140upx;
		line-height: 110upx;
		text-align: right;
	}
	.usericond{
		width: 100upx;
		height: 100upx;
	}
	.jjhkkxert{
		width:132upx;
		height:60upx;
		line-height: 60upx;
		background:rgba(22,137,213,1);
		border-radius:12upx;
	}
</style>
